-
Notifications
You must be signed in to change notification settings - Fork 30
Fix inline image resize parameter to require space before = when title present #2017
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: reakaleek <[email protected]>
Co-authored-by: reakaleek <[email protected]>
@copilot would it be possible to require a space if there is a title and a space not required if there is no title |
Co-authored-by: reakaleek <[email protected]>
Yes! Updated the regex to require a space before Now works:
Does not work:
Changes in commit |
🔍 Preview links for changed docs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🐈
Fixes the inline image sizing syntax to make the space before
=
optional when there's no title, but required when a title is present. This provides better clarity in the syntax.Problem
The image resize parameter required a whitespace before the
=
sign to work correctly:This was unintuitive and caused confusion, as documented in #2014 (comment).
Solution
Updated the regex pattern in
LinkRegexExtensions.MatchTitleStylingInstructions()
from\s\=
to(?:^|\s)\=
, implementing nuanced behavior:=
is optional=
is required (for clarity)What Now Works
What Does Not Work
When a title is present, the space before
=
is required to clearly separate the title from the sizing parameters.Changes
DiagnosticLinkInlineParser.cs
and added.TrimEnd()
for proper title extractiondocs/syntax/images.md
to clarify when space is required vs optionalThis change maintains backwards compatibility for all previously working syntax while preventing the ambiguous
"My Title=50%"
format.Fixes #2016
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.